Large computer systems typically store data on one or more movably mounted disks coated with remanent magnetic material, also known as a direct access storage device (DASD). Either fixed block or variable length records are recorded along circular track extents formatted on the disks. The tracks are concentric such that a movable arm with a read or write head or a switchable set of fixed heads must be positioned or activated over the desired track to effectuate transfer of the records to or from the disk. The set of all tracks that can be accessed without repositioning the access mechanism is termed a "cylinder". For example, a DASD storing 500 tracks per disk would include 500 cylinders. These cylinders may be grouped in logical or arbitrary sets. Contiguous cylinders are grouped together to form "bands" such that cylinders 0-10 might be a first band, 11-100 a second band, etc. For efficient data movement between the computer and the DASD, a track's worth of data or even cylinder's worth of data is transferred at one time from the DASD to another level of storage called a cache.
A cache is a special purpose high speed buffer interposed between a processor and a larger but slower storage device. If data is stored in the cache, then it can be accessed by applications executing on the processor (termed a "hit") in a shorter amount of time than if it were stored in the larger but slower device. If data is not in the cache when referenced (termed a "miss"), then access must be made to the slower device. Cache performance measures include the ratio of the number of hits or misses to the total number of input/output (I/O) requests. These are denominated the "hit ratio" or "miss ratio", respectively. The advantage of caching arises from the tendency of applications to make repeated references to the same data. This clustering of data is termed "locality of reference".
Two types of reference locality are temporal locality and spatial locality. Temporal locality refers to an application's tendency to repeatedly reference the same data record. Spatial locality refers to an application's tendency to reference two or more nearby data records. To increase both cache performance and the hit ratio, conventional methods employed either track caching or record caching depending on whether the data exhibited temporal locality or spatial locality.
Track caching is well suited to take advantage of both temporal and spatial locality. When a record not already contained in the cache is referenced, a track-based cache algorithm proceeds by bringing this record into the cache (staging), together with any other records that follow it on the same track. Preceding records on the same track may also be staged, in some circumstances and/or implementations. A track-based stage enables subsequent hits to occur either to the record that was the immediate target of the stage (temporal locality), or to nearby records (spacial locality). The mixed workloads characteristic of a general-purpose large-system environment usually exhibit both temporal and spacial locality. For this reason, track caching has been the traditional standard for general-purpose storage controls.
For an application with almost no spacial locality, however, there is a lower probability of future references to subsequent records on the same track, while the high miss ratios associated with such data cause large amounts of staging. The advantages of staging records other than the one requested may therefore be outweighed by high staging overhead. The unnecessary staging adds to device utilization, staging path load, and cache memory use.
Record-based caching provides an alternative type of cache service for such data sets. In record caching, only the requested record is brought into the cache. Record caching avoids wasting effort and cache memory to stage unneeded data, while still taking advantage of any temporal locality (repeated references to the same record) exhibited by the application.
The use of record cache has traditionally been restricted to special-purpose storage controls, which access records randomly, such as airline reservations systems or other types of transaction processing facilities, for example. In contrast, general-purpose storage controls have provided track caching, due to its broader applicability.
However, selective use of record-based caching in a general-purpose storage control offers the potential to achieve significant performance advantages. This is because many individual workloads in a general-purpose environment display primarily temporal locality, not spacial locality. A performance advantage can be achieved by selecting record-based caching for these workloads only, and selecting track-based caching for the remaining data.
Many conventional methods exist which changes cache modes to suit the particular data. One method has the ability to select track caching or no caching only through host software, but does not have the ability to select record caching. This method therefore leads to unnecessary staging and inefficient use of the cache.
Another host-software-based method has the capability to switch between track-based caching and record-based caching. The decision to employ record caching, however, is limited. The host software identifies which data sets are processed using record caching mode based only on hit ratios. If the hit ratios are low, then the host assigns record-based caching as a way to reduce the staging load associated with each miss. The host software does not have sufficient information to determine whether the hit ratio enjoyed by a specific data set is primarily due to temporal or to spacial locality because the host does not have access to such data. In other words, the host has no ability to decide why hits are obtained and then to use that information to decide whether to use record caching. The host, therefore, is unable to select record caching for the full range of appropriate data.
Another method first divides a storage device into bands of data, and then selectively assigns track caching to bands based on the hit ratio. If the hit ratio is above a predetermined threshold a band, then track caching is assigned to that band since the number of hits justifies staging. If the hit ratio falls below a predetermined threshold, then track caching is disabled, saving staging cost. As stated above, track caching takes advantage of both temporal and spacial locality. However, this method is not optimized for data sets that have primarily temporal locality.
Accordingly, what is needed is a system and method for dynamically switching between record caching and track caching to enable an aggressive selection of record caching for all appropriate data. The present invention addresses such a need.